CC := gcc
CXX := g++
LD := gcc
RM := rm

CC_FLAGS := -g -Wall -Icore
CXX_FLAGS :=  -Icore
LD_FLAGS := -lz -lpng -lgdi32 -lgdiplus -lws2_32 -lstdc++

BIN := tinyplugin.exe

OBJS :=  \
core/tp_bitmap.o \
core/tp_source_idle.o \
win32/tp_pipe_win32socket.o \
win32/tp_source_win32.o \
core/tp_memory.o \
core/tp_globals.o \
core/tinyplugin.o \
core/tp_main_loop.o \
win32/tp_platform_win32.o \
core/tp_bitmap_factory.o \
core/tp_wnd_manager_default.o \
win32/tp_display_win32.o \
core/tp_source_primary.o \
demo/main.o \
core/tp_wnd_manager.o \
win32/tp_backend_win32.o \
core/tp_log.o \
core/tp_image_png_decoder.o \
win32/tp_image_decoder_win32.o

.PHONY: all clean

all: $(BIN)

$(BIN): $(OBJS)
	$(LD) $^ -o $@ $(LD_FLAGS)

include Makefile.dep

clean:
	$(RM) $(OBJS) $(BIN)
